modifying to update the readme and extend test loop - #70
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the example “repeat” loops (snapshot/restore runs) to 10 iterations for clearer performance comparisons, refreshes the README to point at the upstream plat-hyperlight branch, and adds a helper script to run all examples and capture timings.
Changes:
- Update multiple example Justfiles from
run-5/--repeat 4torun-10/--repeat 9. - Update README instructions to clone
unikraft/kraftkiton theplat-hyperlightbranch. - Add
examples/run-all-examples.shto build/rootfs/run each example and write a summary.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Points kraftkit clone instructions at upstream unikraft/kraftkit plat-hyperlight branch. |
| examples/shell/Justfile | Changes repeated run target to run-10 / --repeat 9. |
| examples/rust/Justfile | Changes repeated run target to run-10 / --repeat 9 (but leaves a mismatched usage comment). |
| examples/python/Justfile | Changes repeated run target to run-10 / --repeat 9. |
| examples/python-tools/Justfile | Changes repeated run target to run-10 / --repeat 9. |
| examples/powershell/Justfile | Changes repeated run target to run-10 / --repeat 9. |
| examples/nodejs/Justfile | Changes repeated run target to run-10 / --repeat 9. |
| examples/go/Justfile | Changes repeated run target to run-10 / --repeat 9. |
| examples/dotnet/Justfile | Renames repeated run target to run-10 / --repeat 9 (comment still says “Run 5 times”). |
| examples/dotnet-nativeaot/Justfile | Renames repeated run target to run-10 / --repeat 9 (comment still says “Run 5 times”). |
| examples/run-all-examples.sh | New script to run all examples and summarize timings (currently has repeat-target mismatches and failure-handling issues). |
Comments suppressed due to low confidence (1)
examples/run-all-examples.sh:114
- Failures from
run_exampleare not captured, and the script unconditionally prints "ALL DONE" at the end with a zero exit status. This can hide build/rootfs failures (and any run failures) when the script is used in automation. Track a global failure flag and exit non-zero if any example fails, and consider adjusting the final message to reflect partial failures.
# Examples with their repeat commands (from each Justfile)
run_example "helloworld-c" "run-5"
run_example "rust" "run-5"
run_example "go" "run-10"
run_example "shell" "run-5"
run_example "python" "run-10"
run_example "python-tools" "run-10"
run_example "nodejs" "run-10"
run_example "dotnet" "run-10"
run_example "dotnet-nativeaot" "run-10"
run_example "powershell" "run-10"
run_example "hostfs-posix-c" "run-5"
run_example "hostfs-posix-py" "run-5"
run_example "multifn-c" ""
run_example "python-agent" ""
run_example "networking-py" "run-get"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" | tee -a "$SUMMARY"
echo "✅ ALL DONE — $(date)" | tee -a "$SUMMARY"
echo "Per-example logs: results-<name>.txt"
echo "Summary: $SUMMARY"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # | ||
| # just run - Run once | ||
| # just run-5 - Run 5x (snapshot/restore) | ||
| # just run-5 - Run 10x (snapshot/restore) |
Comment on lines
21
to
+24
|
|
||
| # Run 5 times via snapshot/restore | ||
| run-5: | ||
| hyperlight-unikraft {{kernel}} --initrd {{initrd}} --repeat 4 --memory {{memory}} | ||
| run-10: | ||
| hyperlight-unikraft {{kernel}} --initrd {{initrd}} --repeat 9 --memory {{memory}} |
Comment on lines
21
to
+24
|
|
||
| # Run 5 times via snapshot/restore | ||
| run-5: | ||
| hyperlight-unikraft {{kernel}} --initrd {{initrd}} --repeat 4 --memory {{memory}} | ||
| run-10: | ||
| hyperlight-unikraft {{kernel}} --initrd {{initrd}} --repeat 9 --memory {{memory}} |
Comment on lines
+95
to
+97
| run_example "rust" "run-5" | ||
| run_example "go" "run-10" | ||
| run_example "shell" "run-5" |
| echo "▶ $name" | tee -a "$SUMMARY" | ||
| echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" | tee -a "$SUMMARY" | ||
|
|
||
| cd "$SCRIPT_DIR/$name" |
Comment on lines
+28
to
+35
| # Build | ||
| printf " [build] running... " | ||
| local t0=$(date +%s%N) | ||
| just build < /dev/null > "$outfile" 2>&1 | ||
| local rc=$? | ||
| local t1=$(date +%s%N) | ||
| local build_ms=$(( (t1 - t0) / 1000000 )) | ||
| if [ $rc -eq 0 ]; then |
Contributor
|
Pushed updates addressing copilot feedback and restructuring the scripts: Justfile fixes (all examples):
Scripts restructured:
Squashed into a single commit to keep history clean. |
Signed-off-by: ralph squillace <ralph@squillace.com> Signed-off-by: Danilo Chiarlone <danbugs@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update all example repeat loops to 10 iterations for clearer performance comparisons, point README at upstream kraftkit plat-hyperlight branch, and add cross-platform test scripts.
run-5/--repeat 4torun-10/--repeat 9unikraft/kraftkiton theplat-hyperlightbranchscripts/test-examples.sh(Linux) andscripts/test-examples.ps1(Windows) to run one example per language (C, Rust, Go, .NET, PowerShell, Shell, Python) with timing